package com.dyh.quickdemozwei.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("time")
public class TimeController {

    @GetMapping("/wait/{time}")
    public Object wait(@PathVariable Integer time){
        try {
            log.info("开始执行");
            Thread.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("结束执行");
        return time;
    }

}
